__author__ = 'xiaosu'

from octopus import add_host
from multiprocessing import Pool


def madd(ip):
    ip=ip
    username="cassandra"
    password="cassandra"
    myhost=add_host.new_host(ip,username,password,"3",True,True,"test")
    myhost.open()
    myhost.insert_2_database()
    print myhost.result

ips=["10.1.199.71","10.1.199.72","10.1.199.73","10.1.199.74","10.1.199.75","10.1.199.76"]
ips=[]
for i in xrange(70,99):
    ip="10.1.199."+str(i)
    ips.append(ip)

print ips

pool=Pool()
pool.map(madd,ips)
pool.close()
pool.join()

